#include <iostream>
#include <cstring>
#include <cstdio>
#include <stdlib.h>
#include <math.h>
#include <time.h> 
using namespace std;

int main(){
	int n,sum=0;
	int t;
	bool flag=true;
	int weight[17]={7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};
	char b[19];
	char check[12]={'1','0','X','9','8','7','6','5','4','3','2'};
	cin>>b;
	while(n--){
			for(int i=0;i<18;i++){
		sum+=(b[19]-'0')*weight[i];
		
	}
	t=sum%11;
	if(b[17]!=check[t]){
		cout<<b<<endl;
		flag=false;
	}
	
	}
if(flag){
	cout<<"ALL PASS";
} 
	
}
